<%--
  Created by IntelliJ IDEA.
  User: wang
  Date: 2022/11/28
  Time: 13:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--这个页面就是显示被举报的商品列表--%>
<html>
<head>
    <title>举报信箱</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
    <script src="js/jquery-3.6.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-inverse">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button
                    type="button"
                    class="navbar-toggle collapsed"
                    data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1"
                    aria-expanded="false"
            >
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">校园易物平台系统</a>
            <a class="navbar-brand text-right">欢迎登陆${admin.name}

        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
<%--                <li class="active">--%>
<%--                    <a href="#">Link <span class="sr-only">(current)</span></a>--%>
<%--                </li>--%>
    <li><a href="${pageContext.request.contextPath}/index.jsp">退出</a></li>

    <li><a href="${pageContext.request.contextPath}/ShowAllGoodsController">交易广场</a></li>
                <li class="active"><a href="#">举报信箱</a></li>
    <li><a href="${pageContext.request.contextPath}/adminreport.jsp">发布公告</a></li>

    <li class="dropdown">
                    <a
                            href="#"
                            class="dropdown-toggle"
                            data-toggle="dropdown"
                            role="button"
                            aria-haspopup="true"
                            aria-expanded="false"
                    >Dropdown <span class="caret"></span
                    ></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search" />
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Link</a></li>
                <li class="dropdown">
                    <a
                            href="#"
                            class="dropdown-toggle"
                            data-toggle="dropdown"
                            role="button"
                            aria-haspopup="true"
                            aria-expanded="false"
                    >Dropdown <span class="caret"></span
                    ></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
</nav>
<div class="container">
    <table class="table table-striped">
        <caption>举报信箱</caption>
        <thead>
        <tr>
            <th>商品序号</th>
            <th>商品名称</th>
            <th>商品类型</th>
            <th>交易媒介</th>
            <th>交易方式</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${badgoods}" var="badgood">
            <tr>
                <td>${badgood.id}</td>
                <td>${badgood.goodname}</td>
                <td>${badgood.goodtype}</td>
                <td>${badgood.changemedium}</td>
                <td>${badgood.changeway}</td>
<%--                <td>--%>
<%--                    <a href="<c:url context='${pageContext.request.contextPath}' value='/DeleteGoodsController?id=${badgood.id}'/>">封禁商品</a>&nbsp;--%>
<%--                </td>--%>
            </tr>
        </c:forEach>



        </tbody>
    </table>
<%--    以下仍为分页现实的代码，同之前的页面--%>
    <nav aria-label="Page navigation">
        <ul class="pagination">

            <li>

                <c:if test="${page.pageIndex > 1}">
                    <a href="<c:url context='${pageContext.request.contextPath}' value='/ShowAllBadGoodsServlet?pageIndex=${page.pageIndex -1}'/>" aria-label="Previous" >
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </c:if>
                <c:if test="${page.pageIndex == 1}">
                    <a aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </c:if>
            </li>
            <li><a href="<c:url context='${pageContext.request.contextPath}' value='/ShowAllBadGoodsServlet?pageIndex=1'/>">首页</a></li>

            <li><a href="<c:url context='${pageContext.request.contextPath}' value='/ShowAllBadGoodsServlet?pageIndex=${page.totalPages}'/>">尾页</a></li>
            <li>

                <c:if test="${page.pageIndex < page.totalPages}">
                    <a href="<c:url context='${pageContext.request.contextPath}' value='/ShowAllBadGoodsServlet?pageIndex=${page.pageIndex +1}'/>" aria-label="Previous">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </c:if>
                <c:if test="${page.pageIndex == page.totalPages}">
                    <a  aria-label="Previous">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </c:if>
            </li>
        </ul>
    </nav>


</div>
</body>
</html>
